package org.sbbs.security.webapp.action;

import java.util.List;

import org.sbbs.base.webapp.action.BaseDwzAction;
import org.sbbs.security.service.MenuManager;

public class MenuTreeMaintainAction extends BaseDwzAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 
	 */
	private MenuManager menuManager;

	public void setMenuManager(MenuManager menuManager) {
		this.menuManager = menuManager;
	}

	private List fullTreeList;
	private Long from, target;

	public final List getFullTreeList() {
		return fullTreeList;
	}

	public final Long getFrom() {
		return from;
	}

	public final void setFrom(final Long from) {
		this.from = from;
	}

	public final Long getTarget() {
		return target;
	}

	public final void setTarget(final Long target) {
		this.target = target;
	}

	public final String displayFullTree() {
		this.fullTreeList = this.menuManager.findAll();
		return SUCCESS;
	}

	public final String move() {
		this.menuManager.move(from, target);
		return SUCCESS;
	}
}
